-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed schema type not being deduced correctly in compute defaults #1334 #1338
Conversation
@t-moe thanks! Can you add a test to make sure this bug doesn't regress? |
@epicfaace done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename those tests as I suggested? Thanks
Is there an Eta for this to be merged into master? |
Nothing pending, I just forgot to check on this. Thanks for the reminder @goralight ! |
@epicfaace No worries! Thank you for merging and thank you @t-moe for fixing the bug. Could we expect a release soon ? :D |
@epicfaace As mentioned, I'm not sure this is yet fully resolved in the latest commit. Would be great to hear your thoughts on this. It looks like the default values are rendered in the editor, but in some cases these default values are not actually part of the submitted formData. |
Reasons for making this change
As described in bug report #1334, the "default" values of schemas are not correctly applied to anyOf/oneOf properties.
This PR fixes that.
anyOf/oneOf schema don't have 'type' properties sometimes, so we needed to use
getSchemaType(schema)
instead ofschema.type
incomputeDefaults
Checklist